package org.redrock.test.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Data
@Configuration
@PropertySource(value = "classpath:weixin.properties")
@ConfigurationProperties(prefix = "weixin")
public class WeixinConfig implements Cloneable {
    private String token;
    private String appId;
    private String secret;
    private String redirect;

    @Override
    public Object clone() {
        WeixinConfig weixinConfig = new WeixinConfig();
        weixinConfig.setAppId(appId);
        weixinConfig.setRedirect(redirect);
        weixinConfig.setSecret(secret);
        weixinConfig.setToken(token);
        return weixinConfig;
    }
}
